@include("user.head")
	<!-- 公共头部 -->
	<div id="content_person">
	<div class="row">
		<div class="col-xs-3">
		@include('user.uc.navigation')
		</div>
		<div class="col-xs-9">
			<div class="person_right">
				<div class="yndw_info">
					<div class="form-horizontal">
					  <fieldset>
					    <legend>专业技术人员名册</legend>
					    <div class="form-group">
					      <label for="inputEmail" class="col-xs-2 control-label label_size">姓名</label>
					      <div class="col-xs-10">
					        <input class="form-control input_size" name="real_name" id="inputEmail" placeholder="" type="text">
					      </div>
					    </div>

					    <div class="form-group">
					      <label class="col-xs-2 control-label label_size">性别</label>
					      <div class="col-xs-10">
					        <div class="radio">
					        	<label>
					            <input name="gender" id="" value="1" checked="" type="radio">
					            男
					          </label>
					          <label>
					            <input name="gender" id="" value="0" type="radio">
					            女
					          </label>
					        </div>
					      </div>
					    </div>
					    <div class="form-group">
					      <label for="inputEmail" class="col-xs-2 control-label label_size">学历</label>
					      <div class="col-xs-10">
					        <input class="form-control input_size" name="education" id="inputEmail" placeholder="" type="text">
					      </div>
					    </div>

					    <div class="form-group">
					      <label for="inputEmail" class="col-xs-2 control-label label_size">专业</label>
					      <div class="col-xs-10">
					        <input class="form-control input_size" name="profession" id="inputEmail" placeholder="" type="text">
					      </div>
					    </div>

					    <div class="form-group">
					      <label for="inputEmail" class="col-xs-2 control-label label_size">职称</label>
					      <div class="col-xs-10">
					        <input class="form-control input_size" name="job" id="inputEmail" placeholder="" type="text">
					      </div>
					    </div>
					    <div class="form-group">
					      <div class="col-xs-10 col-xs-offset-2">
					        <button type="button" id="sub" class="btn btn-primary ">保存修改</button>
					      </div>
					    </div>
					  </fieldset>
					</div>
				</div>
			</div>
		</div>
	</div>
	</div>

	<!-- 公共底部 -->
	@include("user.footer")
	<!-- 公共底部 -->
	@include("user.common")
</body>
<script type="text/javascript">
var pid;
var url = "edit_artisan/add";
if("<%Input::has('pid')%>")
{
	var pid = "<%Input::get('pid')%>";
	$.get("edit_artisan/get_artisan", {pid : pid}, function (data){
		$("input[name='real_name']").val(data.real_name);
		$("input[name='education']").val(data.education);
		$("input[name='profession']").val(data.profession);
		$("input[name='job']").val(data.job);
		$("input[name='gender']").each(function(k, v){
			if($(this).val() == data.gender)
			{
				$(this).attr("checked", "checked");
			}
		})
		url = "edit_artisan/update";

	})
}

$("#sub").click(function(){

	var real_name = $("input[name='real_name']").val().trim();
	var gender = $("input[name='gender']:checked").val();
	var education = $("input[name='education']").val().trim();
	var profession = $("input[name='profession']").val().trim();
	var job = $("input[name='job']").val().trim();

	if(real_name == '')
	{
		warning("", "姓名不能为空");
		return;
	}
	$.post(url, {
		real_name : real_name,
		gender : gender,
		education : education,
		profession : profession,
		job : job,
		pid : pid
	}, function (data){
		if(data.success)
		{
			success("", "提交成功");
			setTimeout(function(){
				window.location.reload();
			}, 2000)
		}
		else
		{

		}
	})
})




</script>
</html>